package org.robustcoupe.task.example;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.robustcoupe.task.AsyncerDecorator;
import org.robustcoupe.task.example.resources.GenesisCoupeTask;
import org.robustcoupe.task.example.resources.LoggingFailoverTask;
import org.robustcoupe.task.example.resources.TaskEventHandler;
import org.robustcoupe.task.example.resources.TiburonCoupeTask;
import org.robustcoupe.task.example.resources.TuscanyCoupeTask;

public class MoreComplexDecoratorExample {
  static final Log LOG = LogFactory.getLog(MoreComplexDecoratorExample.class);

  public static void main(String[] args) throws Exception {
    new GenesisCoupeTask()
      .wrappedByAspect()
        .before(new TiburonCoupeTask())
        .after(new TuscanyCoupeTask())
      .wrappedByRetryFailover()
        .failover(new LoggingFailoverTask())
        .retryCount(1)
      .wrappedByAsycer()
        .event(new TaskEventHandler())
      .execute();
    AsyncerDecorator.shutdown();
  }
}
